.class public Lcom/instagram/android/people/widget/b;
.super Landroid/widget/FrameLayout;
.source "FaceBoxesView.java"


# instance fields
.field private a:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List",
            "<",
            "Lcom/instagram/pendingmedia/model/FaceBox;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 0
    .parameter

    .prologue
    .line 20
    invoke-direct {p0, p1}, Landroid/widget/FrameLayout;-><init>(Landroid/content/Context;)V

    .line 21
    return-void
.end method

.method private a(I)Lcom/instagram/android/people/widget/a;
    .locals 1
    .parameter

    .prologue
    .line 40
    invoke-virtual {p0, p1}, Lcom/instagram/android/people/widget/b;->getChildAt(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Lcom/instagram/android/people/widget/a;

    return-object v0
.end method

.method private a(Lcom/instagram/android/people/widget/a;)V
    .locals 7
    .parameter

    .prologue
    .line 59
    invoke-virtual {p1}, Lcom/instagram/android/people/widget/a;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/pendingmedia/model/FaceBox;

    .line 61
    invoke-virtual {v0}, Lcom/instagram/pendingmedia/model/FaceBox;->a()Landroid/graphics/RectF;

    move-result-object v0

    .line 62
    invoke-virtual {p0}, Lcom/instagram/android/people/widget/b;->getMeasuredWidth()I

    move-result v1

    .line 63
    invoke-virtual {p0}, Lcom/instagram/android/people/widget/b;->getMeasuredHeight()I

    move-result v2

    .line 65
    new-instance v3, Landroid/graphics/RectF;

    iget v4, v0, Landroid/graphics/RectF;->left:F

    int-to-float v5, v1

    mul-float/2addr v4, v5

    iget v5, v0, Landroid/graphics/RectF;->top:F

    int-to-float v6, v2

    mul-float/2addr v5, v6

    iget v6, v0, Landroid/graphics/RectF;->right:F

    int-to-float v1, v1

    mul-float/2addr v1, v6

    iget v0, v0, Landroid/graphics/RectF;->bottom:F

    int-to-float v2, v2

    mul-float/2addr v0, v2

    invoke-direct {v3, v4, v5, v1, v0}, Landroid/graphics/RectF;-><init>(FFFF)V

    .line 68
    new-instance v0, Landroid/widget/FrameLayout$LayoutParams;

    invoke-virtual {v3}, Landroid/graphics/RectF;->width()F

    move-result v1

    float-to-int v1, v1

    invoke-virtual {v3}, Landroid/graphics/RectF;->height()F

    move-result v2

    float-to-int v2, v2

    invoke-direct {v0, v1, v2}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V

    .line 71
    const/16 v1, 0x33

    iput v1, v0, Landroid/widget/FrameLayout$LayoutParams;->gravity:I

    .line 72
    iget v1, v3, Landroid/graphics/RectF;->left:F

    float-to-int v1, v1

    iput v1, v0, Landroid/widget/FrameLayout$LayoutParams;->leftMargin:I

    .line 73
    iget v1, v3, Landroid/graphics/RectF;->top:F

    float-to-int v1, v1

    iput v1, v0, Landroid/widget/FrameLayout$LayoutParams;->topMargin:I

    .line 75
    invoke-virtual {p1, v0}, Lcom/instagram/android/people/widget/a;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    .line 76
    return-void
.end method

.method private a(Lcom/instagram/pendingmedia/model/FaceBox;)V
    .locals 4
    .parameter

    .prologue
    .line 50
    new-instance v0, Lcom/instagram/android/people/widget/a;

    invoke-virtual {p0}, Lcom/instagram/android/people/widget/b;->getContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Lcom/instagram/android/people/widget/a;-><init>(Landroid/content/Context;)V

    .line 51
    new-instance v1, Landroid/widget/FrameLayout$LayoutParams;

    invoke-virtual {p1}, Lcom/instagram/pendingmedia/model/FaceBox;->a()Landroid/graphics/RectF;

    move-result-object v2

    invoke-virtual {v2}, Landroid/graphics/RectF;->width()F

    move-result v2

    float-to-int v2, v2

    invoke-virtual {p1}, Lcom/instagram/pendingmedia/model/FaceBox;->a()Landroid/graphics/RectF;

    move-result-object v3

    invoke-virtual {v3}, Landroid/graphics/RectF;->height()F

    move-result v3

    float-to-int v3, v3

    invoke-direct {v1, v2, v3}, Landroid/widget/FrameLayout$LayoutParams;-><init>(II)V

    invoke-virtual {p0, v0, v1}, Lcom/instagram/android/people/widget/b;->addView(Landroid/view/View;Landroid/view/ViewGroup$LayoutParams;)V

    .line 53
    invoke-virtual {v0, p1}, Lcom/instagram/android/people/widget/a;->setTag(Ljava/lang/Object;)V

    .line 55
    invoke-direct {p0, v0}, Lcom/instagram/android/people/widget/b;->a(Lcom/instagram/android/people/widget/a;)V

    .line 56
    return-void
.end method


# virtual methods
.method public a()V
    .locals 2

    .prologue
    .line 33
    const/4 v0, 0x0

    :goto_0
    invoke-virtual {p0}, Lcom/instagram/android/people/widget/b;->getChildCount()I

    move-result v1

    if-ge v0, v1, :cond_0

    .line 34
    invoke-direct {p0, v0}, Lcom/instagram/android/people/widget/b;->a(I)Lcom/instagram/android/people/widget/a;

    move-result-object v1

    .line 35
    invoke-direct {p0, v1}, Lcom/instagram/android/people/widget/b;->a(Lcom/instagram/android/people/widget/a;)V

    .line 33
    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    .line 37
    :cond_0
    return-void
.end method

.method protected onSizeChanged(IIII)V
    .locals 0
    .parameter "w"
    .parameter "h"
    .parameter "oldw"
    .parameter "oldh"

    .prologue
    .line 45
    invoke-super {p0, p1, p2, p3, p4}, Landroid/widget/FrameLayout;->onSizeChanged(IIII)V

    .line 46
    invoke-virtual {p0}, Lcom/instagram/android/people/widget/b;->a()V

    .line 47
    return-void
.end method

.method public setFaceBoxes(Ljava/util/List;)V
    .locals 2
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/instagram/pendingmedia/model/FaceBox;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 24
    .local p1, faceBoxes:Ljava/util/List;,"Ljava/util/List<Lcom/instagram/pendingmedia/model/FaceBox;>;"
    if-eqz p1, :cond_0

    .end local p1           #faceBoxes:Ljava/util/List;,"Ljava/util/List<Lcom/instagram/pendingmedia/model/FaceBox;>;"
    :goto_0
    iput-object p1, p0, Lcom/instagram/android/people/widget/b;->a:Ljava/util/List;

    .line 25
    invoke-virtual {p0}, Lcom/instagram/android/people/widget/b;->removeAllViews()V

    .line 27
    iget-object v0, p0, Lcom/instagram/android/people/widget/b;->a:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_1
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v0

    if-eqz v0, :cond_1

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/pendingmedia/model/FaceBox;

    .line 28
    invoke-direct {p0, v0}, Lcom/instagram/android/people/widget/b;->a(Lcom/instagram/pendingmedia/model/FaceBox;)V

    goto :goto_1

    .line 24
    .restart local p1       #faceBoxes:Ljava/util/List;,"Ljava/util/List<Lcom/instagram/pendingmedia/model/FaceBox;>;"
    :cond_0
    new-instance p1, Ljava/util/ArrayList;

    .end local p1           #faceBoxes:Ljava/util/List;,"Ljava/util/List<Lcom/instagram/pendingmedia/model/FaceBox;>;"
    invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V

    goto :goto_0

    .line 30
    :cond_1
    return-void
.end method
